﻿Public Class FrmGenero

    Private Sub GeneroBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles GeneroBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.GeneroBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.EjercicioDataSet)

    End Sub

    Private Sub FrmGenero_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'EjercicioDataSet.Genero' table. You can move, or remove it, as needed.
        Me.GeneroTableAdapter.Fill(Me.EjercicioDataSet.Genero)

    End Sub

    Private Sub btnCerrar_Click(sender As System.Object, e As System.EventArgs) Handles btnCerrar.Click
        If Me.EjercicioDataSet.HasChanges() Then
            Dim resultado As DialogResult = MessageBox.Show("La tabla tiene cambios, desea guardarlos antes de cerrar", "Atención", MessageBoxButtons.YesNoCancel)
            Select Case resultado
                Case Windows.Forms.DialogResult.Yes
                    Me.TableAdapterManager.UpdateAll(Me.EjercicioDataSet)
                    Me.Close()
                Case Windows.Forms.DialogResult.No
                    Me.Close()
            End Select
        Else
            Me.Close()
        End If
    End Sub
End Class